<template>
  <div style="height: auto;overflow: auto;display: flex;flex-direction: column;border-right: 2px solid #f8f8f8;padding-right: 10px;">
    <div class="auto" v-for="type in fileTypes" style="padding-left: 5px;margin-top: 5px;">
      <input class="magic-radio" type="radio" name="filetype" :value="type" :id="'querytypes-radio-'+$index" v-model="types" >
      <label :for="'querytypes-radio-'+$index">{{type.type}}</label>
    </div>
  </div>
</template>

<script>
import allData from './fileconfig'

export default {
  title: '综合查询类型',
  data () {
    return {
      fileTypes: allData.allData,
      types: ''
    }
  },
  // ready () {
  //   this.$emit('filetypes-change', allData.allData[0])
  // },
  props: ['baseType'],
  ready () {
    this.types = this.baseType
  },
  watch: {
    'types' () {
      this.$emit('filetypes-change', this.types)
    },
    'baseType' (val) {
      console.log('观察到基本类型变化', val)
      if (val) {
        this.types = val
        this.baseType = null
      }
    }
  }
}
</script>
